package com.dinim.physics2D;


import java.awt.geom.AffineTransform;

import com.dinim.graphics.IDrawable;
import com.dinim.graphics.IGraphicsContext;

public class BoundingBox2D implements IBoundingBox2D, IDrawable {

    private double left, top, right, bottom;

    public BoundingBox2D(double left, double top, double right, double bottom) {
        this.left = left;
        this.top = top;
        this.right = right;
        this.bottom = bottom;
    }

    public double getBottom() {
        return bottom;
    }

    public double getLeft() {

        return left;
    }

    public double getRight() {

        return right;
    }

    public double getTop() {

        return top;
    }

    public void setBottom(double bottom) {
        this.bottom = bottom;
    }

    public void setLeft(double left) {
        this.left = left;
    }

    public void setRight(double right) {
        this.right = right;
    }

    public void setTop(double top) {
        this.top = top;
    }

    public void draw(IGraphicsContext gc) {
//        gc.drawText("" + Math.round(top), (int)left, (int)top+12);
//        gc.drawText("" + Math.round(bottom), (int)left, (int)bottom);
//        gc.drawText("" + Math.round(left), (int)left, (int)(top+(bottom-top)/2));
//        gc.drawText("" + Math.round(right), (int)right, (int)(top+(bottom-top)/2));
        gc.drawRectangle(left, top, right, bottom);
    }

    public String toString() {
        return left + " ; " + top + " ; " + right + " ; " + bottom; 
    }

    
    
}
